package com.example.hotel.service.impl;

import com.example.hotel.dao.DishDao;
import com.example.hotel.entity.Dish;
import com.example.hotel.service.DishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DishServiceImpl implements DishService {
    @Autowired
   private DishDao dishdao;


    @Override
    public int addDish(Dish d){
        int r = dishdao.addDish(d);
        return r;
    }
    @Override
    public int deleteDish(int dishId){
        int r = dishdao.deleteDish(dishId);
        return r;
    }
    @Override
    public int updateDishPrice(int dishId,double price){
        /*int r = dishdao.updateDishPrice(dishId,price);
        return r;*/
        return dishdao.updateDishPrice(dishId,price);
    }

    @Override
    public List<Dish> getAllDish() {
        return dishdao.getAllDish();
    }


}


